import { createApp } from "vue";
import App from "./App.vue";

// 应用全局，全局配置
// 引入饿了吗ui
import Element from "element-plus";
import "element-plus/dist/index.css";
// import ElementPlusIconsVue from "@element-plus/icons-vue";
import * as ElementPlusIconsVue from "@element-plus/icons-vue";
import { UploadFilled } from "@element-plus/icons-vue";
import locale from "element-plus/lib/locale/lang/zh-cn";
// 注意!!!这句必须跟在const app= xxxx  之后
// app.use(ElementPlus, { locale });

// 引入vue-router
import Router from "@/router";

import { createPinia } from "pinia";

// github样式
import VueMarkdownEditor from "@kangc/v-md-editor";
import "@kangc/v-md-editor/lib/style/base-editor.css";
import githubTheme from "@kangc/v-md-editor/lib/theme/github.js";
import "@kangc/v-md-editor/lib/theme/style/github.css";

// highlightjs
import hljs from "highlight.js";

VueMarkdownEditor.use(githubTheme, {
  Hljs: hljs,
  extend(md) {
    // md为 markdown-it 实例，可以在此处进行修改配置,并使用 plugin 进行语法扩展
    // md.set(option).use(plugin);
  },
});

// axios
import axios from "axios";

// 使用use方法导入到全局配置
const app = createApp(App)
  .use(Element, { locale })
  .use(Router)
  .use(ElementPlusIconsVue)
  .use(UploadFilled)
  .use(VueMarkdownEditor)
  .use(createPinia())
  // .use(axios)
  .mount("#app");

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component);
}
